/**产品库存管理-产品库-代购商品API**/
import obj from '@/utils/request'
let {request,baseURL} = obj

//分页查询代购商品
export function getAgentGoods(params) {
  return request({
    url: '/agentGoods',
    method: 'get',
    params
  })
}
//查询单个代购商品
export function getAgentGoodsById(id) {
  return request({
    url: '/agentGoods/'+id,
    method: 'get',
  })
}
//添加代购商品
export function addAgentGoods(data) {
  return request({
    url: '/agentGoods',
    method: 'post',
    data:data
  })
}
//修改代购商品
export function modAgentGoods(data) {
  return request({
    url: '/agentGoods',
    method: 'put',
    data:data
  })
}
//删除代购商品
export function delAgentGoods(ids) {
  return request({
    url: '/agentGoods',
    method: 'delete',
    data:ids
  })
}

//禁用启用代购商品
export function disableOrEnableAgentGoods(stores,params) {
  return request({
    url: '/agentGoods/disableOrEnable',
    method: 'put',
    data:stores,
    params
  })
}
//下载模板文件
export function getAgentGoodsTemplate() {
  return baseURL+'/agentGoods/template'
}

//选择文件
export function agentGoodsOperation(data) {
  return request({
    // baseURL: 'https://jsonplaceholder.typicode.com/posts/',
    url: '/agentGoods/multi/operation',
    method: 'post',
    headers: { 'No-Request-Loading': true },
    data
  })
}

